package net.fltx.taskmgr.entity;

import java.util.Objects;

public class ProcEntry {
    private int pid;
    private String procName;

    public ProcEntry() {
    }

    public int getPid() {
        return this.pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public String getProcName() {
        return this.procName;
    }

    public void setProcName(String procName) {
        this.procName = procName;
    }

    public String toString() {
        return String.format("%08x", this.pid) + " - " + this.procName;
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (o != null && this.getClass() == o.getClass()) {
            ProcEntry procEntry = (ProcEntry)o;
            return this.pid == procEntry.pid && Objects.equals(this.procName, procEntry.procName);
        } else {
            return false;
        }
    }

    public int hashCode() {
        return Objects.hash(new Object[]{this.pid, this.procName});
    }
}
